
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    Image,
    View,
    Button,
    TextInput,
    TouchableOpacity
} from 'react-native';
import NavigatorUtils from '../NavigatorTools/NavigatorUtils'

export default class Page1 extends React.Component {


  constructor(props) {
    super(props);
//    this.state = {
//      mode: "",
//    };
  }



    render() {
        const {navigation} = this.props;
        const {state, setParams} = navigation;
        const {params} = state;

        return (<View >
            <Text >欢迎来到Page1</Text>


            <Button
                title={"Go Back"}
                onPress={() => {
                    NavigatorUtils.resetGoBack(this.props.navigation)
//                    navigation.goBack();
                }}
            />
            <Button
                title={"跳转Tab"}
                onPress={() => {
                    navigation.navigate('Home',{name:"从page1 跳转过去"});
                }}
            />
            <Button
                title={"跳转回主页"}
                onPress={() => {
//                    navigation.navigate('Home',{name:"从page1 跳转过去"});
                        NavigatorUtils.resetToRoute(this.props,'HomePage')
                }}
            />
        </View>)
    }
}